Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

drm/panel: Fix default values for Waveshare 7.9 inch DSI touchscreen #5565

Merged

Conversation

ilarrain
Copy link

@ilarrain ilarrain commented Aug 5, 2023

This fixes touchscreen calibration, axis swapping and inversion.

As referenced in #5550

@pelwell
Copy link
Contributor

pelwell commented Aug 13, 2023

I've read the other thread, and I see that it fixes the original user's problem - thanks for that. Could you say something about changing the dimensions to 4096? Otherwise it looks ready to squash and merge.

@6by9
Copy link
Contributor

6by9 commented Aug 13, 2023

I could have sworn I'd commented on this PR previously, but it seems to have disappeared.

I'd like to confirm what inversions the Waveshare driver uses for the 7.9" panel.
From https://github.com/waveshare/Waveshare-DSI-LCD/blob/main/6.1.21/64/WS_xinchDSI_MAIN.sh#L10 I'm expecting it to be SCREEN_type = 5, which means at https://github.com/waveshare/Waveshare-DSI-LCD/blob/main/6.1.21/64/pi4/WS_xinchDSI.sh#L64 means I'm expecting it to be inverted-x and inverted-y as in the original.
It's possible that Waveshare have an error in their script, but https://github.com/waveshare/Waveshare-DSI-LCD/issues/4#issuecomment-1509490884 largely confirms that was the setting used for that display.

@6by9
Copy link
Contributor

6by9 commented Aug 13, 2023

Ah, the PR I'd commented on was ilarrain#1

@ilarrain
Copy link
Author

ilarrain commented Aug 14, 2023

I've read the other thread, and I see that it fixes the original user's problem - thanks for that. Could you say something about changing the dimensions to 4096? Otherwise it looks ready to squash and merge.

With the default config, only a small touch area (about 2x2 cm) was mapped to the whole screen, rendering it unusable.
I started experimenting with the value on each axis, and the touch area was getting bigger and bigger: 400 > 1080 >
2000 > 3000 > 4000 (it was close to perfect, but not quite) > 4200 (it was too big) > 4096 (it was perfect, ok both axis).
That's how I got to 4096. (2^12, 12 bit resolution on each axis).

I don't know if it applies to other panels, but at list on mine, @beletruz and @mbhangui, the patch fixed the issues. Maybe other panel sizes also use 4096 on both axis. I have no way to experiment, as this is the only panel I've got.

I'd like to confirm what inversions the Waveshare driver uses for the 7.9" panel. From https://github.com/waveshare/Waveshare-DSI-LCD/blob/main/6.1.21/64/WS_xinchDSI_MAIN.sh#L10 I'm expecting it to be SCREEN_type = 5, which means at https://github.com/waveshare/Waveshare-DSI-LCD/blob/main/6.1.21/64/pi4/WS_xinchDSI.sh#L64 means I'm expecting it to be inverted-x and inverted-y as in the original. It's possible that Waveshare have an error in their script, but waveshare/Waveshare-DSI-LCD#4 (comment) largely confirms that was the setting used for that display.

It is type 5 in the scripts for Wavershare installation, which corresponds to those values, you are correct. I have no way to know if it is an error by the manufacturer, or they are apllying an obscure logic in the overlays or kernel modules, as those are closed source. I just know what values work on my panel (and at least 2 other users).

Ah, the PR I'd commented on was ilarrain#1

Sorry about that. I don't know much about git, and ended sending the pull request on the wrong repository. I thought about deleting it, but would have deleted the discussion too.

@6by9
Copy link
Contributor

6by9 commented Aug 22, 2023

I went shopping, and you appear to be right that the display manufacturer (or Waveshare as integrator) have done something very weird in their touch configuration, and plausibly emulated a Goodix touch controller rather than actually using one.

@pelwell The second patch is a fixup of the first. I think we can squash the two commits into one whilst merging, dropping the second commit in the process?
Do we care about the lack of SoB on a dtoverlay patch?

@pelwell pelwell merged commit e89e765 into raspberrypi:rpi-6.1.y Aug 22, 2023
10 of 11 checks passed
@pelwell
Copy link
Contributor

pelwell commented Aug 22, 2023

Yes, no, and done.

popcornmix added a commit to raspberrypi/firmware that referenced this pull request Aug 25, 2023
kernel: drm/panel: Fix default values for Waveshare 7.9 inch DSI touchscreen
See: raspberrypi/linux#5565
popcornmix added a commit to raspberrypi/rpi-firmware that referenced this pull request Aug 25, 2023
kernel: drm/panel: Fix default values for Waveshare 7.9 inch DSI touchscreen
See: raspberrypi/linux#5565
pelwell pushed a commit that referenced this pull request Sep 1, 2023
…5565)

This fixes touchscreen calibration, axis swapping and inversion.

As referenced in #5550
pelwell pushed a commit that referenced this pull request Sep 1, 2023
…5565)

This fixes touchscreen calibration, axis swapping and inversion.

As referenced in #5550
popcornmix pushed a commit that referenced this pull request Sep 5, 2023
…5565)

This fixes touchscreen calibration, axis swapping and inversion.

As referenced in #5550
popcornmix pushed a commit that referenced this pull request Sep 5, 2023
…5565)

This fixes touchscreen calibration, axis swapping and inversion.

As referenced in #5550
popcornmix pushed a commit that referenced this pull request Sep 8, 2023
…5565)

This fixes touchscreen calibration, axis swapping and inversion.

As referenced in #5550
popcornmix pushed a commit that referenced this pull request Sep 12, 2023
…5565)

This fixes touchscreen calibration, axis swapping and inversion.

As referenced in #5550
popcornmix pushed a commit that referenced this pull request Sep 13, 2023
…5565)

This fixes touchscreen calibration, axis swapping and inversion.

As referenced in #5550
popcornmix pushed a commit that referenced this pull request Sep 13, 2023
…5565)

This fixes touchscreen calibration, axis swapping and inversion.

As referenced in #5550
popcornmix pushed a commit that referenced this pull request Sep 19, 2023
…5565)

This fixes touchscreen calibration, axis swapping and inversion.

As referenced in #5550
popcornmix pushed a commit that referenced this pull request Sep 25, 2023
…5565)

This fixes touchscreen calibration, axis swapping and inversion.

As referenced in #5550
popcornmix pushed a commit that referenced this pull request Oct 6, 2023
…5565)

This fixes touchscreen calibration, axis swapping and inversion.

As referenced in #5550
popcornmix pushed a commit that referenced this pull request Oct 11, 2023
…5565)

This fixes touchscreen calibration, axis swapping and inversion.

As referenced in #5550
popcornmix pushed a commit that referenced this pull request Oct 24, 2023
…5565)

This fixes touchscreen calibration, axis swapping and inversion.

As referenced in #5550
popcornmix pushed a commit that referenced this pull request Oct 30, 2023
…5565)

This fixes touchscreen calibration, axis swapping and inversion.

As referenced in #5550
popcornmix pushed a commit that referenced this pull request Nov 16, 2023
…5565)

This fixes touchscreen calibration, axis swapping and inversion.

As referenced in #5550
popcornmix pushed a commit that referenced this pull request Nov 21, 2023
…5565)

This fixes touchscreen calibration, axis swapping and inversion.

As referenced in #5550
popcornmix pushed a commit that referenced this pull request Nov 29, 2023
…5565)

This fixes touchscreen calibration, axis swapping and inversion.

As referenced in #5550
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants